<?php
/* OpenBIBLIO -- A library administration web interface
 * Copyright (C) 2002-2005 Fr&eacute;d&eacute;ric Descamps <lefred@tiscali.be>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

include_once("includes/db.inc");
include_once("includes/functions.inc");
include ("includes/header.inc");

if ($_GET['id']) $id = $_GET['id'];

if ($id) {

 $requete = "SELECT * FROM livres where id = $id";
           if(!($resultat = biblio_db_query($requete)))
           { print "PROBLEME : " .biblio_db_error(); }
           else
           {
                while ($row = biblio_db_fetch_array($resultat))
                {
                        $liv_resume = $row['resume'];
                        $liv_motclefs =  $row['motclefs'];
                        $liv_nom = $row['nom'];
                        $liv_num = $row['num'];
                        $liv_auteur = $row['auteur'];
			$liv_ISBN = $row['ISBN'];
			$liv_id = $row['id'];
			$liv_collection = $row['collection'];
			$liv_edition = $row['edition'];
			$date_ed = $row['date_ed'];
			$genre_ID = $row['genre_ID'];
			$etat_ID = $row['etat_ID'];
			$location_ID = $row['location_ID'];
                }
           }

    echo "<br><div id=tabsearch>";
    echo "<CENTER>";
    echo "<H3>$liv_nom";
    if ($liv_num) echo "($liv_num)";
    echo "</H3><i>$liv_auteur</i></CENTER>";
    echo "<img src=images/covers/$liv_id.jpg align=right>";
    echo "<B>";
    echo _("Date");
    echo "</B><P><i>$date_ed</i></P><BR><B>";
    echo _("R&eacute;sum&eacute;");
    echo "</B><P><i>$liv_resume</i></P><BR><B>";
    echo _("Mots clefs");
    echo "</B><p><i>$liv_motclefs</i><p><br><b>";
    echo _("Etat");
    echo "</b><p>";
    $requete = "select * from etats where id=$etat_ID";
    if(!($resultat = biblio_db_query($requete)))
    { print "PROBLEME : " .biblio_db_error(); }
    else
    {
        while ($row = biblio_db_fetch_array($resultat))
        {
              $etat_id = $row['id'];
              $etat_nom =  $row['etat'];
              $etat_value = $row['value'];
        }
    }
    ?>
        <span style="background-color: #ff0000"><input type=radio name=etat_value value=0 <?php if($etat_value==0) echo "checked"; else echo "disabled"; ?>>0</span>
        <span style="background-color: #fd1006"><input type=radio name=etat_value value=1 <?php if($etat_value==1) echo "checked"; else echo "disabled"; ?>>1</span>
        <span style="background-color: #fe6b10"><input type=radio name=etat_value value=2 <?php if($etat_value==2) echo "checked"; else echo "disabled"; ?>>2</span>
        <span style="background-color: #fe7a12"><input type=radio name=etat_value value=3 <?php if($etat_value==3) echo "checked"; else echo "disabled"; ?>>3</span>
        <span style="background-color: #fed01d"><input type=radio name=etat_value value=4 <?php if($etat_value==4) echo "checked"; else echo "disabled"; ?>>4</span>
        <span style="background-color: #feea20"><input type=radio name=etat_value value=5 <?php if($etat_value==5) echo "checked"; else echo "disabled"; ?>>5</span>
        <span style="background-color: #e5fe26"><input type=radio name=etat_value value=6 <?php if($etat_value==6) echo "checked"; else echo "disabled"; ?>>6</span>
        <span style="background-color: #b4fe2e"><input type=radio name=etat_value value=7 <?php if($etat_value==7) echo "checked"; else echo "disabled"; ?>>7</span>
        <span style="background-color: #7fff36"><input type=radio name=etat_value value=8 <?php if($etat_value==8) echo "checked"; else echo "disabled"; ?>>8</span>
        <span style="background-color: #33ff00"><input type=radio name=etat_value value=9 <?php if($etat_value==9) echo "checked"; else echo "disabled"; ?>>9</span>
        <span style="background-color: #65ff3b"><input type=radio name=etat_value value=10 <?php if($etat_value==10) echo "checked"; else echo "disabled"; ?>>10</span>
    <?
    echo "<BR></div><BR><A HREF=\"search.php\">retour</A>";
}
else {
 print "<H3>". _("Un livre doit &ecirc;tre choisi !") ."</H3>";
}
?>
<br><br>
<div>
<span id=left-text>
<A HREF="index.php">
<?php echo _("retour menu principal"); ?>
</A></span>
</div>
<br>
<?php
include("includes/footer.inc");
?>
